package com.book.dacnhantam;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.Toast;
import com.book.dacnhantam.dialog.AboutDialog;

public class HomeActivity extends Activity
  implements View.OnClickListener
{
  private Button bookmarkButton;
  private SharedPreferences chapterPreferences;
  private Button contentButton;
  AboutDialog mAboutDialog;
  private Button readingButton;

  public void onClick(View paramView)
  {
    if (paramView == this.contentButton)
      startActivity(new Intent(this, TableOfContentsActivity.class));
    while (true)
    {
      return;
      if (paramView == this.readingButton)
      {
        Intent localIntent1 = new Intent(this, ChapterActivity.class);
        int i = this.chapterPreferences.getInt("SCROLL_CHAPTER_PREFS_KEY", -1);
        int j = this.chapterPreferences.getInt("SCROLL_PREFS_KEY", -1);
        if ((i == -1) || (j == -1))
        {
          Toast.makeText(this, getString(2131099650), 0).show();
          continue;
        }
        localIntent1.putExtra("chapter_id", i);
        localIntent1.putExtra("scroll_to", j);
        startActivity(localIntent1);
        continue;
      }
      if (paramView != this.bookmarkButton)
        continue;
      Intent localIntent2 = new Intent(this, ChapterActivity.class);
      int k = this.chapterPreferences.getInt("BOOKMARK_SCROLL_CHAPTER_PREFS_KEY", -1);
      int m = this.chapterPreferences.getInt("BOOKMARK_SCROLL_PREFS_KEY", -1);
      if ((k == -1) || (m == -1))
      {
        Toast.makeText(this, getString(2131099651), 0).show();
        continue;
      }
      localIntent2.putExtra("chapter_id", k);
      localIntent2.putExtra("scroll_to", m);
      startActivity(localIntent2);
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    getWindow().setFlags(1024, 1024);
    setContentView(2130903043);
    this.contentButton = ((Button)findViewById(2131230729));
    this.readingButton = ((Button)findViewById(2131230730));
    this.bookmarkButton = ((Button)findViewById(2131230731));
    this.contentButton.setOnClickListener(this);
    this.readingButton.setOnClickListener(this);
    this.bookmarkButton.setOnClickListener(this);
    this.chapterPreferences = getSharedPreferences("CHAPTER", 0);
    this.mAboutDialog = new AboutDialog(this);
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    getMenuInflater().inflate(2131165185, paramMenu);
    return super.onCreateOptionsMenu(paramMenu);
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    if (paramMenuItem.getItemId() == 2131230738)
      this.mAboutDialog.show();
    return super.onOptionsItemSelected(paramMenuItem);
  }
}

/* Location:           C:\Users\chutieucodon\Desktop\dec\com.book.dacnhantam-36fb9c182ef79376b618c867d3d1c347\classes_dex2jar.jar
 * Qualified Name:     com.book.dacnhantam.HomeActivity
 * JD-Core Version:    0.6.0
 */